import {type ClassValue, clsx} from "clsx"
import {twMerge} from "tailwind-merge"
import {format} from "date-fns";
import {educationOptions, politicalOutlookOptions} from "@/lib/constants";

export function cn(...inputs: ClassValue[]) {
    return twMerge(clsx(inputs))
}

export function formatInfo(key: string, value: any) {
    switch (key) {
        case 'birthDay':
        case 'inWorkTime':
            return format(value, 'yyyy-MM-dd')
        case 'politicalOutlook':
            return politicalOutlookOptions.find((item) => item.value === value)?.label
        case 'education':
            return educationOptions.find((item) => item.value === value)?.label
        case 'gender':
            return value === 1 ? '男' : '女'
        default:
            return value
    }
}